﻿using Game.Entity.NativeWeb;
using Game.Facade;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Game.Web
{
    public partial class DownLoadMoblie : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                string downLoadUrl = "";
                string downLoadIosUrl = "";
                string iosVersion = "";
                string downLoadAndroidUrl = "";
                string androidVersion = "";

                ConfigInfo ci = FacadeManage.aideNativeWebFacade.GetConfigInfo(AppConfig.SiteConfigKey.GameAndroidConfig.ToString());
                if(ci != null)
                {
                    downLoadAndroidUrl = ci.Field1;
                    androidVersion = ci.Field2;
                }
                ci = FacadeManage.aideNativeWebFacade.GetConfigInfo(AppConfig.SiteConfigKey.GameIosConfig.ToString());
                if(ci != null)
                {
                    downLoadIosUrl = ci.Field1;
                    iosVersion = ci.Field2;
                }
                if(Fetch.GetTerminalType(Page.Request) == 1)
                {
                    downLoadUrl = downLoadAndroidUrl;
                }
                else
                {
                    downLoadUrl = downLoadIosUrl;
                }
                Response.Redirect(downLoadUrl);
            }
        }
    }
}